package com.heima.wemedia.feign;

import com.heima.feign.wemedia.IWemediaClient;
import com.heima.model.comment.pojos.CommentSaveDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WemediaClient implements IWemediaClient {
    @Autowired
    private CommentService commentService;

    /**
     * 审核评论
     * @param dto
     * @return
     */
    @Override
    @PostMapping("/api/v1/save")
    public ResponseResult checkComment(@RequestBody CommentSaveDto dto) {
        return commentService.checkComment(dto);
    }
}
